package kr.hkit.powerjava.chapter12.submit; 
//프로그래밍 5번 2차원 도형 하위클래스

class Ellipse extends TwoDimShape {
	double radius = 3 ;
	
	public Ellipse(double radius) {
		this.radius = radius;
	}

	@Override
	public void getArea() {
		System.out.println("원의 면적은 " + Math.round(PI*radius*radius)+"입니다.");
	}
}

class Rectangle2 extends TwoDimShape {
	int width;
	int height;
	
	public Rectangle2(int width, int height) {
		this.width = width;
		this.height = height;
	}

	@Override
	public void  getArea() {
		System.out.println("사각형의 면적은 "+ width*height+"입니다.");
	}
}


class Triangle2 extends TwoDimShape {
	double a ;
	double b ;
	double c ;
	
	public Triangle2(double a, double b, double c) {
		this.a = a;
		this.b = b;
		this.c = c;
	}

	@Override
	public void getArea() {
		System.out.println ("삼각형의 면적은 " + (b*c)/2 + "입니다.");
	}
}

